package com.example.util;

import java.security.NoSuchAlgorithmException;

import com.sun.org.apache.xml.internal.security.utils.Base64;

public class SecEncrypt {
	public static String getSHA1Digest(String value){
		String returnValue = new String();
		java.security.MessageDigest alga;
		try {
			alga = java.security.MessageDigest.getInstance("SHA-1");
			alga.update(value.getBytes());
			byte[] digesta=alga.digest();
			
			return new String(Base64.encode(digesta));
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return returnValue;
	}
}
